package org.anyin.gitee.cloud.center.gateway.filter.factory;

import org.anyin.gitee.cloud.center.gateway.filter.ValidateImageCodeGatewayFilter;
import org.anyin.gitee.cloud.lib.core.cache.CacheTemplate;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.factory.AbstractNameValueGatewayFilterFactory;


public class ValidateImageCodeGatewayFilterFactory extends AbstractNameValueGatewayFilterFactory {

    private CacheTemplate cacheTemplate;

    public ValidateImageCodeGatewayFilterFactory(CacheTemplate cacheTemplate) {
        this.cacheTemplate = cacheTemplate;
    }

    @Override
    public GatewayFilter apply(NameValueConfig config) {
        return new ValidateImageCodeGatewayFilter(config, cacheTemplate);
    }
}
